tests: Support saving temporary directory
authorColin Walters <walters@verbum.org>
Sat, 15 Oct 2011 01:08:09 +0000 (21:08 -0400)
committerColin Walters <walters@verbum.org>
Sat, 15 Oct 2011 01:09:11 +0000 (21:09 -0400)
tests/libtest.sh

index ec0bf165b493d965e680f84bf002e1cf20331358..7fc8ed1faedbc7fc809d73a94576873f3264aeab 100644 (file)
@@ -25,7 +25,11 @@ cd "$test_tmpdir"
 touch "$test_tmpdir/.test$$"
 
 die () {
-    test -f "$test_tmpdir/.test$$" && rm -rf "$test_tmpdir"
+    if test -z "$HT_TESTS_SAVE_TEMPS"; then
+        test -f "$test_tmpdir/.test$$" && rm -rf "$test_tmpdir"
+    else
+        echo "Temporary files saved in $test_tmpdir"
+    fi
 }
 
 trap 'die' EXIT